package netWorkPrograming.tcp.tcp06;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/5/28
 */
public class ThreadPool {
    private ThreadPoolExecutor pool;
    public ThreadPool(int maxPoolsize,int queueSize) {
        pool=new ThreadPoolExecutor(1,maxPoolsize,60L, TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(queueSize));
    }
    public void execute(Runnable task) {
        pool.execute(task);
    }

}
